Added convenience functions that compute g2,g3 as needed