bugs fixed for simulation results