Corrected spacing logic