Rewrite build.sh