simplification of a matrix operation