Can we change the type here to Seq[(K) => Int] which abstracts us from the internals a bit better (should just work to change that).