messed up db.py