Add the computation of the rank vector