Made changes according to the comments