working on Swift version