fix 2 logic errors for problem 2.3