pure_js modified