Adds a few comments to the code and remove DOM assignment