Matrices are now allocated on the heap.