partway through db fxn writing