add a simple update function.