aamath: modernize, document patch