Python 3 fix in simulate.py