Adding new functionality to prefer multiples. Most of the domain has been moved to Kotlin.