A method involving the transformation of methyl ketones to carboxylic acids using excess base and halogen is called the haloform reaction. It begins with the deprotonation of α hydrogen to form an enolate ion which reacts with the electrophilic halogen to give an α-halo ketone. The step continues until all the α protons are substituted to form a trihalomethyl ketone. The resulting molecule is unstable, and in the presence of a hydroxide base, it readily undergoes nucleophilic acyl substitution. This leads to the expulsion of trihalomethyl carbanion and produces carboxylic acid. The carbanion generated is stable owing to the electron-withdrawing effect of the three halogens. Subsequent deprotonation of the acid by carbanion forms a carboxylate and haloform, which is the driving force of the reaction. Finally, acidification of the carboxylate gives the desired product, and the reaction is named after the by-product. Using chlorine or bromine results in immiscible liquids of chloroform and bromoform. In contrast, iodine forms a yellow precipitate of iodoform, often used to detect methyl ketones in unknown substrates.