reversing order of port index