Solved problem 24
improved problem 34 solution