Scala Implementation of Insertion Sort