rewrite code

rewrite code
Merge pull request #13 from katismile/patch-13

rewrite code