Refactored simulator
Removed redundant Flush call