beginning of problem 2