cachematrix implementation; cacheSolve() works with a square matrix or a cachematrix created from a square matrix