Added run_cmd for scanning instead of os.system