assign rank randomly when tied