Wrote Reduce Matrix Method