pure-js modified