Updated for Swift 1.1