working on JS conversion