added total variable