Added functionality to recursively build tree without using control helper