taken python code out of GH definition