created grid with click functions