added value calculating function