End of chapter 12. Runs without throwing and exceptions. Some of the behavior seems to be off. Needs investigating.