code for the ammas paper