Using the matrix and array classes