list comprehension in scala
merge sort using pattern matching in pairs