fixed typo in rank assigment