working on problem 18