Rank works correctly