implementation of ArrayList Iterator