impl in memory. tests to be done.