Functions 1st assignment.

All problems fixed and the math was tested and true.