modified iterator to test iteration without using range