removed -1 in g2