addressed @carpeliam comments on pull request