public LinkedList<interval> getBoundedWindowIntervals(LinkedList<instant>[] instants, IntervalDescription desc)
    {
    	LinkedList<interval> newIntervals = new LinkedList<interval>();
    	
    	LinkedList<instant> startInstants = instants[0];
    	LinkedList<instant> endInstants = instants[1];
    	
    	for(int i = 0; i < startInstants.size(); i++)
    	{
    		instant startInstant = startInstants.get(i);
    		instant endInstant = endInstants.get(i);
    		
    		long timeDiff = (endInstant.date.getTime() - startInstant.date.getTime());
    		
    		long startTime = startInstant.date.getTime();
    		long endTime = endInstant.date.getTime();
    		long milliLength = (long)(desc.boundedWindowLength*60*60*1000);
    		long milliLeap = (long)(desc.boundedWindowLeap*60*60*1000);
    		
    		/*
    		 * If hours difference is lower than expected, just return the only possible interval.
    		 * Else, create all possible intervals moving one hour at a time.
    		 */
    		
    		System.out.println("Patient " + this.id);
    		System.out.println("Difference is " + timeDiff/(60*60*1000) + " hours.");
    		System.out.println("Start date is " + startInstant.date.toString());
    		System.out.println("End date date is " + endInstant.date.toString());
    		System.out.println("Length: " + desc.boundedWindowLength + " hours. Leap: " + desc.boundedWindowLeap + " hours.");
    		
    		if(timeDiff < milliLength)
    		{
    			interval newInterval = new interval(this.id, "boundedWindow", null, startInstant.date, endInstant.date, desc);
    			newIntervals.add(newInterval);
    			System.out.println("There is 1 interval.");
    		}
    		else
    		{
    			int intervalCount = 0;
    			while(startTime + milliLength < endTime)
    			{
    				long limitTime = startTime + milliLength;
    				interval newInterval = new interval(this.id, "boundedWindow", null, new Date(startTime), new Date(limitTime), desc);
        			newIntervals.add(newInterval);
        			startTime += milliLeap;
        			intervalCount++;
    			}
    			System.out.println("There are " + intervalCount + " intervals.");
    		}
    		
    	}
    	
    	return newIntervals;
    }