Improve gf2.py