First crack at problem 4