Implementation of makeCacheMatrix