update the ranks