formatted database.py