Add applyAlignment Function