public void addValue(double dist, Object value) {
			// If there is still room in the heap
			if (values < size) {
				// Insert new value at the end
				data[values] = value;
				distance[values] = dist;
				upHeapify(values);
				values++;
			}
			// If there is no room left in the heap, and the new entry is lower
			// than the max entry
			else if (dist < distance[0]) {
				// Replace the max entry with the new entry
				data[0] = value;
				distance[0] = dist;
				downHeapify(0);
			}
		}