Egg releasing

If your period is the un fertilized egg leaving your body.... Why is my fertile window like right after my period? What is the egg doing in there for the next three weeks?