ENH: performance enhancement, fixes #411
Merge pull request #532 from timvg80/issue-411

ENH: performance enhancement, fixes #411