Rebased after failed merge to local at JSU-WRK-67
Completed simulate function