added history functions, to do: history search