fixed bugs. Can now generate multiple runs