Initial cacheMatrix solution implementation.