improved queue estimation logic