functions for databases

update old functions, create new functions 4:38pm Apr 27 2014