Proper round_robin algorithm.