from main source code: kws added