Created function to return the total amount of consumption