code optimization
Merge pull request #3 from leoner/master

code optimization