Implementation of makeCacheMatrix and cacheSolver