build the calculate part