added closures and examples