add hasLogical
clean up
improve generateGridDesign, NOT DONE