update fixes for pull request #31

updated based on d.newtons suggestions
Merge pull request #2 from othane/master

update fixes for pull request #31