new update/upgrade script, ready for testing