a working version of database access