G functions reworked