4 CH3OH (Glycerin) + 6 I2 (Iodine) + 6 NH3 (Ammonia) → CHI3 (Triiodomethane or Iodoform) + 6 NH4I (Ammonium iodide) + 3 H2O (Water)
In this reaction, the glycerin acts as a reducing agent, transferring electrons to the iodine, which is oxidized. The ammonia provides a basic environment necessary for the reaction to occur. As the reaction proceeds, a yellow precipitate of iodoform is formed, which is insoluble in water. The ammonium iodide remains dissolved in the solution.