Everything is ok save for double-side detection. There is a race condition such that it doesn't detect double-side at speed. Nevertheless this code is working far better than it has.