Added README.md, and refactor code