add class to build 2d square lattice graph