fix rank ordering