Adding a loop to visit all the cursor places.