Scala: bubble sort