updates to db.py and models