rewrote calculation expenses