Changed os.system to subprocess.check_output.