How to create a closure