update while lecture and while example code