Added additional comments

Tried to make it easier to understand JS