Adding Counting Sort in Scala