some amendments based on feedback from greenkahuna/will pull request 38