small speed up

change function duplicate
Merge pull request #1 from behrtam/master

small speed up