working on simulation.js