some code with database access functions