public Double getDistance(int distanceType, Entries other, int VERBOSE) {
		
		int logFlag = 0b10;
		
		// if one of the entries contains nothing, then we cannot 
		// compute the distance
		if (other.size()==0) return null;
		if (this.size() ==0) return null;
		
		// say, we have two timeSeries 1 and 2
		// our assumption timeEnd(i) = timeStart(i+1)
		long initStart1 = this.get(0).timeStart;
		long initStart2 = other.get(0).timeStart;
		
		long len1 = this.get(this.size()-1).timeEnd - initStart1;
		long len2 = other.get(other.size()-1).timeEnd - initStart2;
		
		if (len1 != len2 ) {
			System.err.print("[Dataset.getDistance] Error: Both entries should have the same length.");
			System.exit(1);
		}
		
		Util.logPrintln(VERBOSE, logFlag, "compute distance, length: "+len1);

		// current entry under consideration
		int cur1 = 0;
		int cur2 = 0;
		long min1 = this.get(cur1).timeStart - initStart1;
		long min2 = other.get(cur2).timeStart - initStart2;
		
		if (min1 != min2 ) {
			System.err.print("[Dataset.getDistance] Error: Problem in initial time start.");
			System.exit(1);
		}
		
		long nextMin1 = this.get(cur1).timeEnd - initStart1;
		long nextMin2 = other.get(cur2).timeEnd - initStart2;
		double sym1Double = this.get(cur1).value;
		double sym2Double = other.get(cur2).value;
		
		// choose either min1 or min2 (both should have the same value at this point, i.e., 0)
		long post = min1;
		
		double dist = 0.0;
		while (true) {
			if ( nextMin1 < nextMin2 ) {
				
				// compute symbol differences
				long length = nextMin1 - post;
				dist = dist + computeDistance(distanceType, sym1Double, sym2Double, length);
				
				// update the post
				post = nextMin1;
				Util.logPrintln(VERBOSE, logFlag, "post on ts1: "+ (post+initStart1));
				
				// increase our lookup cursor on timeSeries1
				cur1 ++;

				// update info on timeSeries 1
				min1 = this.get(cur1).timeStart - initStart1;
				nextMin1 = this.get(cur1).timeEnd - initStart1;
				sym1Double = (int) (this.get(cur1).value);
				
			} else {
				

				long length = nextMin2 - post;
				dist = dist + computeDistance(distanceType, sym1Double, sym2Double, length);
				
				post = nextMin2;
				Util.logPrintln(VERBOSE, logFlag, "post on ts2: "+ (post+initStart2) + ", "+(nextMin2 + initStart2));
				
				// increase our lookup cursor on timeSeries2
				cur2 ++;
				if ( cur2 >= other.size() ) break;
				
				min2 = other.get(cur2).timeStart - initStart2;
				nextMin2 = other.get(cur2).timeEnd - initStart2;
				sym2Double = (int) (other.get(cur2).value);
				
			}
		}
		
		return dist;
	}