code: function(data) {
        // Keep the last n states (e.g. - defaults 5)
        var historyLength = _options.historyLength || 5;
  
        if(data) {
          _history.push(data);
        }
  
        // Update length
        if(_history.length > historyLength) {
          _history.splice(0, _history.length - historyLength);
        }
      }
docs: Internal method to add history and correct length
  
  @param  {Object} data An Object