add am example for "g" function