Switched from os.system to subprocess.check_output