much improved CATF; handles Amarna as of this commit