public static ArrayList<Commands> formatCommandList(ArrayList<Commands> list){
        ArrayList<Commands> commands = new ArrayList<>();
        ArrayList<Commands> listCheck = new ArrayList<>(); //Used for parsing
        int size = list.size(); // static list size because of a growing arraylist
        boolean check;
        boolean check2;
        
        for(int i=0;i<size;i++){
            Commands one = list.get(i);
            check = false;
            check2 = false;
            for(int j=i+1;j<size;j++){
                Commands two = list.get(j);
                // Checks for potensial MOVE commands
                if(isMove(one, two)){ 
                    Commands move = new Commands("MOVE", one.getPath(), two.getPath());
                    commands.add(move); //adds all the MOVE commands
                    listCheck.add(move);
                    check = true;
                    break;
                }
            }
            // Filters out ADD and DEL commands not transformed into MOVE
            if(check == false){
                for(Commands kake : listCheck){
                    if(getFileName(one).equals(getFileName(kake)) ){
                        if (getFileName(one).equals(getFileName(kake))) {
                            check2 = true;
                            break;
                        }
                    }
                }
                if(check2 == false){
                    commands.add(one); // adds all the ADD and DEL commands
                }
            }
        }
       return commands;
    }