changes in response to comments in PR
changes in response to PR comments
implement wald interval