another unsuccessful attempt at problem 5E