added recursive version of excercise