fixed #75; incorporated code review comments in to pull request