Change order of code