updates after code review no.2