update code and output simulation