Fix for lecture 7 problem 2 .