added more jsdocs and comment corrections