first version of database operations