code from Lecture 2
code from Lecture 2