Getting a working version of startup code working for Swift