correct solution for problem 32