You can define the order of the squares.
How to change the portal square order:
Drag a square to another position.
Drop the square in the new position.