assignment 7 - fix problem 4