Add maximum length option
Clarify comments in def aggregate()