Working on homework 4 problem 4