new database functionality, plus trying to fix departements