function action = backward_solve_3(cstate)
	[row,col]=size(cstate);
	M=[];  									 # M will become the matrix where Mij = 1 ⇐⇒ button i is toggled on pressing button j
	for x=1:row*col
		for y=1:row*col
			if(abs(y-x) == col | (abs(y-x)<=1 & floor((y-1)/col)==floor((x-1)/col)) )
				v(y)=1;
			else 
				v(y)=0;
			endif
		endfor
	M=[M;v]; 								 # adding ith column as a row. we will transpose it later
	endfor
	for i=1:row
		for j=1:col
			w((i-1)*col+j)=cstate(i,j);   	 # converting cstate into vector 
		endfor
	endfor
	M=[M;w];    							 # making augmented matrix
	M = M';
	guassM=guass_elim(M);  					 # last column is the answer  
	action=[];
	for l=1:row  							 # converting last column as a matrix
		for k=1:col
			Arow(k)=guassM((l-1)*col+k,col*row+1);
		endfor
		action=[action;Arow];
	endfor
endfunction



