problem3 untested but complete