Added ability to read and write from history file