updated the database, cleaned up code in main.py to make it more clean and efficient.