Recursive Functions via Trees