Check profit function