re-upload of working code.

change polinomialApprox to 1 to use polynomial approximation instead of linear.  alpha and beta need to be adjusted with actual data ;)