My first attempt for Programming Assignment 2