fixed iterator, made instructed code changes