Put Chapter 18 logic inside of main() functions