Code cleanup and added flexibility

updated readme
Merge pull request #1 from atayarani/master

Code cleanup and added flexibility