added a gf file and header and other changes

gf.c and gf.h
...