modified builddb.py to include new function