some tidying in gp.py