created ctor wich accepts any iteratortype and added a test for it