x >= 0){index = index-1}
                              return commandHistory[index];
                            };
        saveHistory = function(){
                            window.localStorage.setItem("commandHistory",JSON.stringify(commandHistory));
                        };
        return {
            add: addCommandHistory,
            getPrev: getPreviousCommand,
            getNext: getNextCommand,
            saveHistory: saveHistory
        }
      })();

      function init() {
          if(!