added writing params to model and a prototype of faster initialization of particles