more work on problem3