Completed part 1 of programming assignment 3