move db2array to util.c