makeCacheMatrix and cacheSolve functions for caching matrix inversion