changes to reduce_db.py