multiplying two matrices with different dimensions