took mainDB.py from the Bricky master