Use subprocess rather than os.system