Scala implementation (command-line)