Rewind functionality added

Used 2 stacks to create an environment where we can rewind and continue
our simulation.