@Override
	public JTable display(){
	    //This creates a new array which is the same as result, apart from the title line, the first one in result. 
	    int n = result.length-1;
	    String[][] newArray = new String[n][];
	    System.arraycopy(result,1,newArray,0,n);
	    
	    //This array will be filled with the data we want to display, but is still the same size as our original data array. 
	    display = new String[newArray.length][newArray.length];
	    
	    //The first edge cases are initialised. 
	    display[0][0] = newArray[0][0];
	    display[0][1] = newArray[0][2];
	    display[0][3] = newArray[0][4];
	    int count = 1;
	    int j = 1;
	    Integer[] counter = new Integer[newArray.length];
	    for(int i = 1; i < newArray.length; i++){
	    	counter[i] = 0;
	    		if(newArray[i][0].equals(newArray[i-1][0])){
	    			count++;
	    		}
	    		else{
	    			counter[i] = count;
		    		display[j][0] = newArray[counter[i]][0];
		    		display[j][1] = newArray[counter[i]][2];
		    		display[j - 1][2] = newArray[counter[i] - 1][2];
		    		display[j][3] = newArray[counter[i]][4];
		    		count = counter[i] + 1;
		    		j++;
	    		}	
	    }
	    //The last edge case is initialised as well. 
	    display[j - 1][2] = newArray[count -1][2];
	    
	    //This small_display array contains the data of display[][], but is exactly the size of the numbers of rows that aren't null. 
	    String[][] small_display = new String[j][4];
	    for(int i = 0; i < small_display.length; i++){
	    	for(int k = 0; k< small_display[i].length; k++){
	    		if(display[i][k] != null){
	    			small_display[i][k] = display[i][k];
	    		}
	    	}
	    }
	    
	    Object rowSchedule[][] = small_display;
	    Object columnTitle[] = {"Train", "Start location", "Final destination", "Start time"};
	    JTable table = new JTable(rowSchedule, columnTitle);
	    
	    return table;
	}