Updated (g2) for portability