changed from os.system to use subprocess methods, which is more current