Converted section 3.2 to main()