implementing makeCacheMatrix and cacheSolve functions