creates a simple anonymous closure