Merge pull request #2 from paliwalashish/master

made buffer size configurable
minor refactoring and added docs