Clarify heading variable delcaration

Because several methods are chained on it, for clarity's sake I assign
it to its own variable before looping attribute values and storing the
heading as a key for the values array