Removed unused function updateState().