working on the debug of amortized