fixed bugs in kk.py and kk() function in localsearch.py