using web worker for simulation