Added examples and usage section to README.md, streamlined the code and fixed some simple bugs.