foldRight -> foldLeft in QualityAligner. Scala is not a great language.