Improve quadratic interpolation algorithm
Improve output