Fixed broken references
Moved remaining function to chapter 4