use a web worker for computation/simulation and make the main parameters (M, n, A) configurable