Modified makeCacheMatrix and cacheSolve functions in cachematrix.R