calculate profit