better output of contigs; rewritten for clarigy; corrected alignment to reference