fixed the debug function to print out everything the ithe tree