private void downHeapify(int p) {
			for (int c = p * 2 + 1; c < values; p = c, c = p * 2 + 1) {
				if (c + 1 < values && distance[c] < distance[c + 1]) {
					c++;
				}
				if (distance[p] < distance[c]) {
					// Swap the points
					Object pData = data[p];
					double pDist = distance[p];
					data[p] = data[c];
					distance[p] = distance[c];
					data[c] = pData;
					distance[c] = pDist;
				} else {
					break;
				}
			}
		}