Refactored simulator, removed duplication bug

This merge is going to be terrible