computeG moved in its own source file