Updated for swift 1.1