extract calculation of an open sum in function.