Made some JS tweaks to make it work