Finished chapter 4 problem 1