corrfuncs, have to generalize db funcs