hack in subsidy calculation, translated from original c code