cleaned up history.py