modify rank related functions

forgot to clean the junit test, again...