Changed the location of some code