Completed update(), and added quitting.
Completed update(), and added quitting.