modified for graph-alignment