The rank must be initialized (the code does not always fill the rank values)