adding db.py from tools
adding prep for table sorting