lecture exercise code