add option to count length of .xyz. fix diagonal k vector generation