new code for R, and cleaning seqcluster