Added comparison to more idiomatic usage of Scala.