Trying to work out anonymous functions