added history function