code: function pushToStack(type, entry, check) {
  		// no entry of given type
  		if (typeof stack[type] === 'undefined') {
  			stack[type] = entry;
  		}
  		// apply check function
  		else if (check(stack[type], entry) === true) {
  			stack[type] = entry;
  		}
  	}
docs: adds given entry under the "type" if given check function returns true