Removed redundant code from kd-tree