Answers to chapter 6 questions

This could be simplified to simply !$output_str I think