Programming style: use seq_along() insted of 1:length()