Algorithms in Swift.