pe solution to problem 5