Part 2 of Programming Assignment 1