working on problem 6