public Command getCommand(char operator) {

        switch (operator) {
            case '>':
                return new GoToNextCell();
            case '<':
                return new GotoPrevCell();
            case '+':
                return new IncrementValue();
            case '-':
                return new DecrementValue();
            case '.':
                return new PrintCurrValue();
            case '[':
                return new While(code, currPositionInCode);
        }
        return null;
    }