Minimal changes, preparing for tracking

Perhaps a better way of doing this would be to gut everything from the
sketch that is unneeded and then build up the tracking function. This
might be easier to drop into place.