Adapted to Swift 1.0