some clean up for Ch2, and adressing issue #34 in chapter3