Compare the first and last two measures carefully. The dotted-quarter note is worth three eighth notes. So, the 're' for each pairing happen at the same relative timing which causes the single eighth note to have its own flag in measures 2 and 4 instead of a beam. Keeping the timing for all three notes within a dotted rhythm is called feeling the "sub-division." Doing that will make you very accurate in rhythm!