public void endRect(int x, int y){
		
		int xr; int yb;
		if(x<0){x=0;}if(y<0){y=0;}if(x>xsiz-1){x=xsiz-1;}if(y>ysiz-1){y=ysiz-1;}
		if(xl > x){xr = xl; xl = x;}else{xr = x;}
		if(yt > y){yb = yt; yt = y;}else{yb = y;}
			for(int yc = yt; yc <= yb; yc++){
			for(int xc = xl; xc <= xr; xc++){
				if(rectstate){selectCell(xc,yc);}else{removeCell(xc,yc);}}}
			}