cleaned up pyscript