implement amd for main file