added basic code for memdb