Addded memoization functions