I'm kinda desperate here, I could really use some help.

Magnesium oxalate has a Ksp of 8.6x10^{-5}, and the calcium one has a Ksp of 2.3x 10^{-9}. What pH must be maintained to achieve the maximum separation of the calcium ion from the magnesium ion, if both have a concentration of 0.1 mol/L, and the concentration of oxalic acid is maintained at 0.1 mol/L?

Data: For oxalic acid: Ka1 = 6.5x 10^{-2}, Ka2 = 6.1x10 ^{-5}

Well, I have tried to calculate the molar concentration of C2O4^{2-} using the ksp equation of MgC2O4, letÂ´s name it y.

h2c2o4--->2h+ + c2o42- K=Ka1.Ka2

? 0 Y

-X +2X +X

0,1 2X Y+X

I'm not sure if what I did gives the maximum separation, any suggestions?