I like this plugin, here's some improvements

I know that the diff is ugly, that's because I reformatted it