debugging, now works up to an error in the formulas we're using