Created generic tree builder
Added generic tree builder