I believe @rasterer deserves credit for code, but I deserve the rest. Thanks to @davidmg13 for the idea.