Added AMAT calculation and argument parsing