change algorith of queue