Increased the speed of find nearest