void negateBatteryAtPos(int[] changepos) {
        ArrayList<String> usedAlready = new ArrayList<>();
        int currentSlot = 0; // the current slot: if a repeat is encountered it doesn't count as a slot.
        for (int i = Competition.getInstance().getNextCodeRedMatch(); i < Competition.getInstance().getNextCodeRedMatch() + matches.size(); i++) {
            Battery battery = batteryList.get(wrapIndex(i, batteryList));
            if (usedAlready.contains(battery.getBatteryLetter())) {
                continue;
            }
            usedAlready.add(battery.getBatteryLetter());
            int[] pos = convertSlotToIndex(currentSlot);
            System.out.println("(" + pos[0] + ", " + pos[1] + ")\t" + "(" + changepos[0] + ", " + changepos[1] + ")");
            if (pos[0] == changepos[0] && pos[1] == changepos[1]) {
                battery.setCharged(!battery.isCharged());
                break;
            }
            currentSlot++;
        }
    }