added jsdoc to methods which I can explain
delete redundant and unneeded code