Update newUpdateScript

Bug fixes and more features. Almost complete