KDTree Support; #1936

Solution to #1936