solution to programmingassignment2