reverse contig functions