add anonymous function fn

Issue #8 fix.