End queue ellipse algorithm