now work fine, add some functions to kpdb.py