completed code for assignment 1 part 1
completed code for assignment 1 part 2