Changed to matrix multiplication