Scala insertion sort