Added beginning of update handling code