Set tmp.length only once to the first list length.  Overwrites elements if subsequent list length differ from the first