added functions and solvers for fitting pc data