NASCAR Racing: Pit stop, yellow flag, pit road


Question
I have a two part question about pit stops
1.  General pitstop.  Does the driver "lose" their place in the race by pitting.  If he was first and pits, and no one else does, does the driver end up last?

2.  Pit on yellow flag.  If there is a yellow flag, and the driver pits, do they get their spot back?  Also, on yellow does the leader lose their margin of lead?

Answer
Hi David,

When a pit stop occurs, a driver practically says "I am giving up my spot to get fuel and tires." So to follow your example, if the leader pits and no one else does then yes, he will come out dead last if all the cars are on the lead lap.  
During a yellow flag, all of the drivers come down pit road at one time, so there are no lap rotations.  The restart to green order is determined by who got off of pit road first.  And yes, the leader does lose any margin to second place if the caution comes out.  This makes for some exciting finishes.
Hope I answered you question.
Coy