Moved the checking of matrix to makeCacheMatrix