Scala port of the SLMC