Updated for ProgrammingAssignment2