compounded simulation code to run from a single script