Moved total length up on the same line as td.
Added end-of-document.