Closes #22, closes #125. Chapter 4 finished.