Preformance tweak

should be merged after pull request #52