updated grid for gui, seg fault fix