changes to DB, added tests for DB