Adding some more comments in code and documentation and fixing the click
event.preventDefault() code.