moved lambda implementation to demo, for demo purposes