MAL aggregate function difficulty