some code for swift