Changed a few of the update codes to be sorted