@Override
	public void iterate() {
		
		for (int i = 0; i < this.length; i++) {
			String cellPattern = "" + cells().leftOf(i, 1) 
					                + cells().getCell(i).toBit() 
					                + cells().rightOf(i,1);
			switch(cellPattern){
			
			case "111":
				applyRule(0, i);
				break;
			case "110":
				applyRule(1, i);
				break;
			case "101":
				applyRule(2, i);
				break;
			case "100":
				applyRule(3, i);
				break;
			case "011":
				applyRule(4, i);
				break;
			case "010":
				applyRule(5, i);
				break;
			case "001":
				applyRule(6, i);
				break;
			case "000":
				applyRule(7, i);
				break;
				
			}
		}
		this.updateCells( buffer() );
		this.next();
	}