Add logging
Fix bug
Add paranoid asserts
Little fix to find implementation+make it accept iterable