addressed issues raised by Dave in the code review