hmmm when i had to do something like this before i used a slightly different technique. what i did was i would take the array of characters, add index 0 to the act order (since theres no one faster in the empty array). then for the rest of the characters i would compare their speed to all the characters in the act order array. if you find a character that your test case is faster than then you insert the test into the array at their index.
below is a example of something like i mentioned.