Moved the first round of code in