implemented CRUD functions