sort queue in chronological order, history in reverse chronological.