Translated (most) scripts to JS