updated documentation for lambda
added memoize function