solved problem 18
solved problem 19