solved problem 4
solved problem 5