Moving functions around to make easier to work with