Updated based on comments in pull request