Fixed load order

Loads on page now, rearranged functions/variables so they load in the
proper order.