first recursive functions
added tree example