`diff_result_to_cell()` sets `item['state']` for you already; you don't need line 14 or 16.