Done implementing rank function.