Function calcProfit

completed block for function variables