implemented history retrieval.