Made some changes to try and make the build script better