re-order subs so _ is defined when used