aggregateAlignment function