Functions to fit monotone polynomials