public void check() throws IllegalStateException {
	  Run currentRun = getFirst();
	  int curLength = 0;
	  int totalLength = width * height;
	  
	  while(hasNext(currentRun)) {
		  if((currentRun.getRunType() == currentRun.getNext().getRunType())
			&&(currentRun.getHungerVal() == currentRun.getNext().getHungerVal())) {
			  
			  currentRun = currentRun.getNext();
			  break;
		  }
		  
		  curLength += currentRun.getRunLength();
		  currentRun = currentRun.getNext();
	  }
	  
	  if(curLength != totalLength)
		   throw new IllegalStateException("Sum of Run lengths not equal to RunLengthEncoding length ");
	  
	  else if(currentRun.getRunType() == currentRun.getPrev().getRunType()
			 && currentRun.getHungerVal() == currentRun.getPrev().getHungerVal())
		  throw new IllegalStateException("RunLengthEncoding contains consecutive runs of same runType and hungerVal");
	  
  }