fixed #46
tested and fixed
fixed whitespace
Merge branch 'issue-46'