imporoved length of outputed sequence