How to add variable data included in calculating final total?