initial commit of database function