Moved around some code