Word Count implementation in Scala