Solving problem 6.