start index at 1 in formats.agp.mask()