Finished first version of auto-update script