swapped two lines of code for clarity