Improving the pythong script that automates compilation and organization of output files