Solved problem 19 on PE