Recusive solution, more functional!