README is updated.
Refactored the code