Crystallization of calcium carbonate in the presence of metal ions