Improved getRank