Changed the order of the way things run to make more sense