adjustments to update function