Re-wrote the build script