Function block

setting the function for calculating profit