kv algorithm model