reworked to return an iterator