merging some changes from jrollins.