Replace Python with JS