add validation/tests per Chap 6 exercises