Code review

Please check the comments for this code review