ProgrammingAssignment2 of coursera R course