I've never made a pull request before.

Here it is.

Let me know what you think. I'm sure there's better ways to handle the loadout sorting, but I wound up resorting to what I think was a hack to make it work.