reordered setup script