add build_database.py and rebuild the database