read/write AGM files working