lots of changes trying to get run_and_capture to work like I wanted