finished the alignment construction part
merged with local (changes for alignment construction)