Adding logic to makeCacheMatrix