try moving gfunc