Completed the 2 functions needed for assignment