this is the rank all function