Modify chapter 4 exercise files, including comment formatting and code flow