adding the sawtooth polynomial.
re-ordering some code.