Completed first part of problem 7.