Instructor's solution

re-did my algorithm using the instructors code that I modified taking
out some unnecessary stuff.
Also added in another fun function or two.