added general setup to run()