function

algorithm of computing the results