added some tests
added jsdoc