correct spacing calculations