Improved selecting and deleting through tree