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