Working simulator

Merge working simulator back into master