solved problem 26
solved problem 27
solved problem 40