private void Heapify(int i) {

        int left = (2*i + 1);
        int right = (2*i + 2);

        Racer leftRacer = null;
        Racer rightRacer = null;


        if(left < heapSize-1)
        {
            leftRacer = heapArray[left];
        }

        if(right < heapSize-1)
        {
            rightRacer = heapArray[right];
        }

        Racer currRacer = heapArray[i];
        int smallest = i;

        if(left < heapSize-1 && leftRacer.getStart() > currRacer.getStart() && leftRacer.getEnd() < currRacer.getEnd())
        {
            int score = currRacer.getScore();
            currRacer.setScore(++score);
            smallest = left;
            currRacer = heapArray[left];
        }
//        else if(left < heapSize-1 && leftRacer.getStart() < currRacer.getStart() && leftRacer.getId() > currRacer.getId())
//        {
//            int score = currRacer.getScore();
//            currRacer.setScore(++score);
//            smallest = left;
//            currRacer = heapArray[left];
//        }

        if(right < heapSize-1 && rightRacer.getStart() > currRacer.getStart() && rightRacer.getEnd() < currRacer.getEnd())
        {
            int score = currRacer.getScore();
            currRacer.setScore(++score);
            smallest = right;
            currRacer = heapArray[right];
        }
//        else if(right < heapSize-1 && rightRacer.getStart() < currRacer.getStart() && rightRacer.getId() > currRacer.getId())
//        {
//            int score = currRacer.getScore();
//            currRacer.setScore(++score);
//            smallest = right;
//            currRacer = heapArray[right];
//        }

        if(smallest != i)
        {
            swap(smallest , i);
            Heapify(smallest);
        }
    }