fixed with better impl
Merge pull request #22 from liyu1981/dev

fixed with better impl