created a class for memoize func by overriding __call__