refactor balance totals, add period detail view