adds an example with a closure