fixed calculation and output of agent AP
commented useless debug output