fixed iterator, everything seems to work