Added JSDoc, renamed vars