First implementation of the cacheMatrix functions