Add optional line totals. Closes #1.