corrected problem 10. Misunderstood the problem statement