changed X_j to G_j in ex2