beginning of problem 5