Changed: 
Now I check if the list is empty and restart the counter if it is.