comments to example
friendly error message
optional memoization for generic functions