Scala conversion 'script' for Pliny (needs cleanup)