add walk to calculate ranks for classes and functions