memoize calculateScore