Swift programming exerise.