Made changes according to comments