Added code samples from lecture notes.