change perspective to matrix multiplication