still having problems with 0 matrix