my solution to ex3.22 is yuck, but since my solution to ex3.23 with nested matches is nicer, I've kind of redeemed myself...