Initial working code for Programming Assignment 2