updated for changes to Swift in beta 5