Magnesium distribution in the synthesis of biphasic calcium phosphates