Moved some lines for clarity