<% if answer[:dependency].nil? && @questions[index + 1] != nil %>
  <%= question[:id] %>{"<%= question[:label] %>"} --> |"<%= key %>"| <%= @questions[index + 1][:id] %>["<%= @questions[index + 1][:label] %>"]
<% elsif !answer[:dependency].nil? %>
  <%= render partial: "dependency.txt", locals: { question: question, index: index, key: key, answer: answer } %>
<% end %>

<% if answer[:dependency].nil? && @questions[index + 1] != nil %>
  <%= question[:id] %>{"<%= question[:label] %>"} --> |"<%= key %>"| <%= @questions[index + 1][:id] %>["<%= @questions[index + 1][:label] %>"]
<% elsif !answer[:dependency].nil? %>
  <%= render partial: "dependency.txt", locals: { question: question, index: index, key: key, answer: answer } %>
<% else %>
  <%= question[:id] %>{"<%= question[:label] %>"} --> |"<%= key %>"| finalSection["End"]
<% end %>

Add end block for legal section
Add end block for legal section
