moved the iterator constructor inside the lambda(were it should have been, duh)