adding functional/persistent version + tests.