Integrating most of code  in main into their own function in test_run. now the user interface is basically the only thing going on in the main function.