Added tree radius function and other minor changes.