add comments and reorder for logical affinity