Yeah, that code is pretty awful. It's here at least in part for advice on
improvements. =) I'll make another run at it tomorrow.