You introduced `root` for a good reason. I recommend replacing `window` with `root`.