changed the scope of run_a_code()