moved simulator JS to its own file