app: Sort the order in which units move