rewrite to js
rewrite to js, adds