experimentation with first class functions in Swift