Creation of function that includes described calculation and return