iterator homework