generateGrid put into own file