modified ToLRTree Method to build tree auto