Cliqqs backend algorithms in scala