changed order of generating files