WMWT: Chnged way to compute ranks
WMWT: Work in progress