Completed up through problem 2b