Added code for lecture #5.