Merged Chetan's Changed to Simulation.c
Merging Chetan's Code