Implement AggregateAlgorithm interface and MaxAlgorithm.