reformatting and adding rank