Improving carousel algorithm