work in progress on new CalcZcurves