Completed part 3 of assignment1