old calc_profit