Optimize length of output