Finishes the custom iterator exercise