adding the first swift version (not complete)