corrected grid referencing in updated cells, created unrefershedCells function,  slightly updated main