public static void MaxHeapify (List<Integer> array, int i){
		int left = (i*2) - 1;
		int right = (i*2);
		int largest;
		
		/*condition checks if there is a right side and if it's bigger*/
		if(right<=array.size() && array.get(left)>array.get(i-1)){
			largest = left;
		}
		else{
			largest = i - 1;
		}
		
		/*condition checks if there is a left side and if it's bigger*/
		if(right+1<=array.size() && array.get(right)>array.get(largest)){
			largest = right;
		}
		
		/*swaps values*/
		if(largest != i-1){
			array.set(i-1, array.get(i-1) + array.get(largest));
			array.set(largest, array.get(i-1) - array.get(largest));
			array.set(i-1, array.get(i-1) - array.get(largest));
			
			MaxHeapify(array, largest);
		}
	}