All code from lectures.