change queue ordering to be more efficient