diagnostics and changes in simulate.py