Trying to speed up the memoization by identifying duplicate nodes