Improved the alignment interaction loop.
Rewrote interaction code in weave and fixed problem related to it. Also improved handling of matrix diagonals.