run_jobs function