refractor the code and changed for new version
Merge pull request #3 from rajmahendra/master

refractor the code and changed for new version