completed assignment  2 code

completed the fill-in-the-function exercise for the 2 functions