cleanup and slight optimization
Merge pull request #9 from fent/master

cleanup and slight optimization