update problem 5
Solving problem 5