This is a pretty elegant solution to the key problem.

Details.