from code review with Dave