orderTotals function working