improve space optimization
don't add space for tiny gaps