Extensive changes to run generation