Some fixes and a slight refactoring
Updated README.md