generating grid with gui