documenting g_ function