Implement iterator. Update main.