made changes according to comments