func sortFunc (array: [Int], closure: (Int?, Int) -> Bool) -> Int {
var tempVar: Int? = nil
for value in array {
if closure (tempVar, value) {
tempVar = value
}
}
return tempVar!
}
if closure (tempVar, value) {
tempVar = value
}