Changes in g matrix calc