public String runMachine() {
        curState = cmds.get(0).getCurState();
        Character readSymb = tape.get(0);
        while(0 <= searchCommand(curState, readSymb)) {
            Command tmpCurCmd = cmds.get(searchCommand(curState, readSymb));
            tape.set(idCurCell, tmpCurCmd.getNewSymb());
            // If command wan't found
            if(tmpCurCmd.getNextState() == -1) {
                break;
            }
            // If tape's head needs to move left and index of the current cell is the start of the ArrayList
            // then need to increase our ArrayList to the left side
            if((tmpCurCmd.getMoveDirection() == -1) && (idCurCell == 0)) {
                tape.add(0, ' ');
            }
            // Else tape's head needs to move right and index of the current cell is the end of the ArrayList
            // then need to increase our ArrayList to the right side
            else if((tmpCurCmd.getMoveDirection() == 1) && (idCurCell == tape.size() - 1)) {
                tape.add(' ');
                idCurCell++;
            }
            // Otherwise
            else {
                if((tmpCurCmd.getMoveDirection() == -1)) {
                    idCurCell--;
                }
                else if((tmpCurCmd.getMoveDirection() == 1)) {
                    idCurCell++;
                }
                else {
                    // tape's head stays on the same cell
                }
            }
            curState = tmpCurCmd.getNextState();
            readSymb = tape.get(idCurCell);
        }
        return tape.toString();
    }