Added preprunning; plus other changes