Moved around variables in main