Some extensions to Swift