add countNonZero to Matrix operations