remove for loop, create next() function