Sort the machine array