added js and tests