minor modifications to finding average queue length