Greg Eakin

Results 2 issues of Greg Eakin

This version was tested, and a few small bugs were fixed.

Refactored the code to make it simpler to read. Also, added checks on the input parameter, to see if they're invalid. -- Greg