Here's an idea I was working on.

I've compiled it, but it needs testing in the lab.