Working on the field sorting JS logic.