added JSdoc comments