now kinda also works in JS