total calculation functionality added