Using arrays instead of matrices.