Added more functionality to Swift example