changed db.py to return dictionary of values