func swapTwoValues<type>(a: inout type, _ b: inout type) {
    let temporaryA = a
    a = b
    b = temporaryA
}