small changes to annotate.py and py_db