corrected tree functionality.