use seq_len instead of 1:nperm