add two functions for merging replicates