add contig functions
fixed error within dynamic loop to allow parallelization