addressed most code review comments