Minor adjustments to update function