Rewrite update.sh