changed js to vanilla