Well, here slightly scary code became full-on terrifying. See my other comment about the borders on the selection. Looking at this, I'm *very* suspicious that there are a bunch of bugs hiding in it. This is exactly what bug-hiding code looks like. We should somehow simplify it. I just don't know how yet ;)