Converted everything to raw JavaScript