example task done - but without tail recursion