completed assignment 2

completed the 2 functions