A slightly improved hack that avoids awkward spaces in the output