Test and check for G as matrix