Modified readme file and added comments to javascript