Example code for lec 10