Added feature to calculate total