Made a better implementation of the script ordering tweaks in the prior commit.