First working snippet. Still need to make it a plugin for real. :P