private static final double distanceBase(double[] coord1, double[] coord2, int order)
	{
		if (coord1.length != coord2.length)
			throw new IllegalArgumentException ("Number of dimensions is not equal");
		
		final int NUM_DIMENSIONS = coord1.length;
		double distance = 0;
		
		for (int d = 0; d < NUM_DIMENSIONS; d++) {
			double absDiff = Math.abs (coord2[d] - coord1[d]);
			distance += Math.pow (absDiff, order);
		}
		
		distance = Math.pow (distance, (1.0 / order));;
		
		return distance;
	}