Another crucial aspect of chemical treatment is the removal of heavy metals and other harmful substances. Various chemical agents, such as lime, sodium sulfide, or chelating agents can be introduced to precipitate heavy metals, allowing them to be efficiently removed. This is particularly important in industrial areas where water may be contaminated by metals like lead, mercury, or cadmium. Ion exchange is another method that can be quite effective for softening hard water by replacing calcium and magnesium ions with sodium ions.