Optimizing Queue