added jsdoc comments
applied counting depending on unix time