Finished nearest neighbor search for kd-tree
Fixed bug in quick select; nearest neighbor works correctly