remove redundant total calculation