addressed most of the comments in the code review