update build rank function