reorganizing code for parametric bootstrap simulation