initialize and connect grid points