change to take into account names when wrting alignments