Basic Rank(i) implementation started, but not complete