attempt at problem 4