add prototype of KW algorithm