Working on an AMS summary function