Lecture 4 first example, using Functions