more work on problem 3