#202 Eliminate unnecessary recalculation, looping, and memory allocation.
Merge pull request #203 from pisch/issue202

#202 Eliminate unnecessary recalculation, looping, and memory allocation...