Solved problem 37 on PE