What is the logic that determines when to insert the extra space?