I now have something that mostly works. The next step is to make it efficient.