added an example script that runs the whole workflow and fixed a few small but important bugs in the simulation code and the way initial structures were chosen