ProgramingAssignment2 final solution