Added the code for Programming Assignment 2