Improved efficiency of alignment calculation.