first half completed, code review by Lindsay