Solved #37 recursively