newer lecture 4 code