implemented history sort of