fix bug and comment memoize