updated db stuff, added more testing