Profit calculating bug fix