adding Scala to the loop