updated based on comments from PR