implemented user history function.