Wrote update function