Modified main.py to write to history on every command entered