modifications according to comments from the pull request