public boolean isValidCommand(ArrayList commands)
    {
        int commandsCount = commands.size();

        if(!validCommands.get(commandsCount-1).isEmpty() && validCommands.get(commandsCount-1).contains(commands.get(0))) {
            return true;
        }

        return false;
    }