class 1 homework

Wrote two different functions for the homework.  One I did in class and the other I did at home.  The second function was an attempt to make the code shorter.
this doesnt look correct though