restructured the build script