add rank logic