Implementing naive matrix multiplication.