Coursera Programming assignment2