Bugfix: memoization was affecting results