beefed up readme with documentation and examples
added inline documentation in code