compute profit