Change 1:n to seq_len(n)