added demo code from lecture 8