Comments added to the code

The code is now heavily commented and the README.md file is changed.