Improved update script (actually works)