implement "g" function