lecture 5 iteration