problem3 typo corrected