memdb implemented and tested