finished sample code for lessons