More complete implementation of update script