Chapter4 Example 11: fixed update code