first attempt at dbhandler code