even better handling of the upstreamstate stuff

Now pull out ahead/behind counts and compare directly.