found my older draft. Added tests.