This extension was created by Max Glenister.

You can view the full source on GitHub, and I'm sure you can improve it.