Implemented makeCacheMatrix and cacheSolve using recommended implementation according to the example.