Coprecipitation is the contamination of a precipitate by otherwise soluble species and occurs via different processes. Surface adsorption can introduce impurities in colloidal precipitatessuch as barium sulfate. Here, a primary layer of adsorbed barium ions and a secondary layer of nitrate counterions result in contamination by barium nitrate. Sometimes, ions in a crystal lattice can undergo isomorphous replacement by inclusions of ions of similar charge and size. For example, during the precipitation of cadmium sulfide, manganese in the solution can replace cadmium to form a mixed crystal. Mixed-crystal formation can be prevented by removing the interfering ion or using a different precipitant. In occlusion, foreign ions are trapped within the growing lattice. Similarly, pockets of solution are trapped between adjacent crystals in mechanical entrapment. Slow precipitation can minimize occlusion, whereas rapid dissolution and reprecipitation can remove it.