Added comments
Added directories for JSDoc input
Simplified code