restructured simulator, simulator now works