changes made according to comments