Updated for ordering and retrying.