create conditions to automatically add a total